#include<iostream>
#include<assert.h>

using namespace std;

class Date
{
	friend ostream& operator<<(ostream& out, const Date& d);
	friend istream& operator>>(istream& in, Date& d);
public:
	Date(int year=1, int mouth=1, int day=1);
	void Print();
	bool CheckDate();

	bool operator<(const Date& d);
	bool operator<=(const Date& d);
	bool operator>(const Date& d);
	bool operator>=(const Date& d);
	bool operator==(const Date& d);
	bool operator!=(const Date& d);

	Date& operator+=(int day);
	Date operator+(int day);
	Date& operator-=(int day);
	Date operator-(int day);

	Date& operator++();
	Date operator++(int);
	Date& operator--();
	Date operator--(int);


	int operator-(const Date& d);


	/*int GetYear();
	int GetMonth();
	int GetDay();*/


	

	int GetMouthDay(int year, int mouth, int day)
	{
		assert(mouth > 0 && mouth<13);
		static int mouthday[13] = { -1,31,28,31,30,31,30,31,31,30,31,30,31 };
		if (mouth == 2 && ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0))
		{
			return 29;
		}
		return mouthday[mouth];
	}


private:
	int _year;
	int _mouth;
	int _day;
};